#ifndef _RENDER_TARGET_APP_H
#define _RENDER_TARGET_APP_H

#include <system/application.h>
#include <graphics/sprite.h>
#include <maths/vector2.h>
#include <maths/vector3.h>
#include <vector>
#include <graphics/mesh_instance.h>
#include <graphics/vita/texture_vita.h>
#include <graphics/model.h>

// Vita AR includes
#include <camera.h>
#include <gxm.h>
#include <motion.h>
#include <libdbg.h>
#include <libsmart.h>

#include "Player.h"
#include "Camera.h"
#include "GameObject.h"
#include "Meshes.h"
#include "Bullet.h"
#include "EnemyMgr.h"
#include "maths\quaternion.h"
#include <tgmath.h> 
#include <iostream>

#include "Collision.h"

#include "GameState.h"
#include "PlayState.h"
#include "MarkerLostState.h"
#include "MenuState.h"
#include "GameOverState.h"

// FRAMEWORK FORWARD DECLARATIONS
namespace abfw
{
	class Platform;
	class SpriteRenderer;
	class Font;
	class Renderer3D;
	class Mesh;
	class RenderTarget;
	class TextureVita;
	class SonyControllerInputManager;
}


class ARApp : public abfw::Application
{
public:
	ARApp(abfw::Platform& platform);
	void Init();
	void CleanUp();
	bool Update(float frame_time);
	void Render();

private:
	void InitFont();
	void CleanUpFont();
	void RenderCameraFeed(struct AppData* dat);
	void Render3DScene();
	void RenderOverlay();
	
	//-- game states
	GameState* mGameState;
	PlayState* mPlayState;
	MarkerLostState* mLostState;
	MenuState* mMenuState;
	GameOverState* mGameOverState;

	abfw::SpriteRenderer* mSpriteRenderer;
	abfw::Font* mFont;

	float mFps;

	//-- restart game
	bool mRestart;

	//-- projection matrices
	abfw::Matrix44 mProj2D;
	abfw::Matrix44 mProj3D;
	abfw::Matrix44 mView;

	float mDisplayAspectRatio;
	float mCameraImageAspectRatio;
	float mVecticleScaleFactor;

	abfw::Sprite mCameraSprite;
	abfw::TextureVita mCameraSpriteTexture;

	class abfw::Renderer3D* mRenderer3D;

	//-- stores default ambient light colour
	abfw::Colour mDefaultColour;
};

#endif // _RENDER_TARGET_APP_H